<template>
  <div>
    <div class="content">
      <span v-html="newsInfo.content"></span>
    </div>
    <div class="comment">
      <comment></comment>
    </div>
  </div>
  
</template>

<script> 
import {Toast} from 'mint-ui';
import Comment from '../subComponent/comment.vue';
export default {
  created(){
    this.getNewsInfo();
  },
  data(){
    return{
      id: this.$route.params.id,//将url中的地址传过来id 挂载到data上
      newsInfo: {}
    }
  },
  methods:{
    getNewsInfo(){
      this.$http.get('http://www.liulongbin.top:3005/api/getNew/'+this.id).then(result=>{
        if(result.body.status == 0){
          this.newsInfo = result.body.message[0]
        }
      })
    }
  },
  components:{
    "comment" : Comment
  }
}
</script>

<style lang="stylus" scoped>
.content{
  padding :5px;
}
</style>